package com.tjhzzx.ibmsSupervisor.model.user;


import com.tjhzzx.ibmsSupervisor.enums.BSubSystemType;
import com.tjhzzx.ibmsSupervisor.model.common.BCommonSubSystem;

import javax.baja.sys.Flags;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.BFolder;
import javax.baja.web.BWebServlet;
import java.util.logging.Logger;

/**
 * @author Luc
 * @date 2020-01-28 20:40
 * @see BCommonSubSystem
 */
public class BUserSubSystem extends BWebServlet {

    private static final Logger LOGGER = Logger.getLogger(BUserSubSystem.class.getName());

    public static final Property title = newProperty(Flags.READONLY, "User Management", null);

    public String getTitle() {
        return getString(title);
    }

    public void setTitle(String v) {
        setString(title, v, null);
    }

    public static final Property servletName = newProperty(Flags.HIDDEN, "", null);

    public String getServletName() {
        return getString(servletName);
    }

    public void setServletName(String v) {
        setString(servletName, v, null);
    }

    public static final Property subSystemType = newProperty(Flags.READONLY, BSubSystemType.page, null);

    public BSubSystemType getSubSystemType() {
        return (BSubSystemType) get(subSystemType);
    }

    public void setSubSystemType(BSubSystemType v) {
        set(subSystemType, v, null);
    }

    public static final Property pagePath = newProperty(Flags.READONLY, "/user", null);

    public String getPagePath() {
        return getString(pagePath);
    }

    public void setPagePath(String v) {
        setString(pagePath, v, null);
    }

    public static final Property url = newProperty(Flags.READONLY, "外部链接 http://", null);

    public String getUrl() {
        return getString(url);
    }

    public void setUrl(String v) {
        setString(url, v, null);
    }

    public static final Property modulesRoot = newProperty(Flags.READONLY, new BFolder(), null);

    public BFolder getModulesRoot() {
        return (BFolder) get(modulesRoot);
    }

    public void setModulesRoot(BFolder v) {
        set(modulesRoot, v, null);
    }

    public BUserSubSystem() {
        super();
        BFolder modulesRoot = new BFolder();
        modulesRoot.add("UserModule", new BUserModule(), null);
        setModulesRoot(modulesRoot);
    }

    @Override
    public Type getType() {
        return TYPE;
    }

    public static final Type TYPE = Sys.loadType(BUserSubSystem.class);
}
